<template>
  <view class="version_box">
    <image class="image" :src="data?.icon" mode="aspectFill" />

    <view class="title">{{ data?.title }}</view>
    <view class="version">{{ data?.version }}</view>
  </view>
</template>

<!-- 版本号 -->
<script lang="ts" setup>
import { ReqSelectSysConfigByCategory } from '@/api/sys_config'
import type { Version } from '@/config/data/data';
import { SysConfigTypeEnum } from '@/config/enum/enum'
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'

const data = ref<Version>()

//页面加载
onLoad(() => {
  ReqSelectSysConfigByCategory({ category: SysConfigTypeEnum.VERSION }).then(
    (res) => {
      if (res.code == 200 && res.data) {
        data.value = JSON.parse(res.data)
      }
    }
  )
})
</script>

<style scoped lang="scss">
.version_box {
  width: 100vw;
  text-align: center;
  min-height: 100vh;
  letter-spacing: 2rpx;

  .image {
    width: 226rpx;
    height: 226rpx;
    border-radius: 50%;
    margin-top: 20%;
  }

  .title {
    font-size: 34rpx;
    margin: 26rpx 0;
  }

  .version {
    font-size: 36rpx;
  }
}
</style>
